package com.ald.crossex.system.wechat;

import com.ald.crossex.service.SystemService;
import org.apache.log4j.Logger;

/**
 * Created by lishijiong on 15/5/4.
 *  刷新系统缓存
 */
public class RefreshSystemCacheJob {


    private static final Logger logger = Logger.getLogger(RefreshSystemCacheJob.class);
    SystemService systemService;

    public SystemService getSystemService() {
        return systemService;
    }

    public void setSystemService(SystemService systemService) {
        this.systemService = systemService;
    }

    public void execute() {

        try {
            int result = systemService.cacheSystem();
            logger.info(String.format("刷新系统缓存成功，共 %d 条记录.",result));

        } catch (Exception e) {
            logger.error("刷新系统缓存失败."+e.getMessage());
        }


    }
}
